//
//  MobileVerifyView.swift
//  Exchange
//
//  Created by 孟祥群 on 2018/4/19.
//  Copyright © 2018年 common. All rights reserved.
//

import UIKit
import SpriteKit
class MobileVerifyView: UIView {
    lazy var promptLabel: UILabel = {
        let label: UILabel = BaseLabel(style: .oneStyle)
        label.font = UIFont.systemFont(ofSize: 12)
        label.text = KMobilePromptText
        label.numberOfLines = 0;
        return label
    }()
    
    lazy var telLabel: UILabel = {
       let label = BaseLabel(style: .twiceStyle)
       label.font = UIFont.systemFont(ofSize: 18)
       return label
    }()
    
    lazy var selectBtn:UIButton = {
        let btn =  CommonBtn.creatSelectBtnWithTitle(title: kText("获取验证码"), y: 141, view: self, sel:  #selector(selectBtnAction))
        return btn
    }()
    
    var dataSource: MobileVerifyViewController!
    
    init(dataSource: MobileVerifyViewController!) {
        super.init(frame: CGRect.zero)
        
        self.dataSource = dataSource
        self.setUpUI()
    }
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func setUpUI() -> Void {
        self.addSubview(promptLabel)
        promptLabel.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(16)
            make.left.equalToSuperview().offset(16)
            make.right.equalToSuperview().offset(-16)
            make.height.lessThanOrEqualTo(50)
        }
       
        self.addSubview(telLabel)
        telLabel.snp.makeConstraints { (make) in
            make.centerX.equalToSuperview()
            make.height.equalTo(25)
            make.top.equalToSuperview().offset(84)
        }
        
        self.addSubview(selectBtn)
    }
    
    @objc func selectBtnAction() -> Void {
        self.dataSource.navigationController?.pushViewController(SMSCodeViewController(), animated: true)
    }
    /*
    // Only override draw() if you perform custom drawing.
    // An empty implementation adversely affects performance during animation.
    override func draw(_ rect: CGRect) {
        // Drawing code
    }
    */

}
